Open
Conversation
Veykril
commented
Jan 4, 2026
Comment on lines
383
to
+389
| pub fn empty(span: DelimSpan) -> Self { | ||
| Self { | ||
| repr: TopSubtreeRepr::SpanStorage96(Box::new([TokenTree::Subtree { | ||
| len: 0, | ||
| delim_kind: DelimiterKind::Invisible, | ||
| open_span: SpanStorage96::new(span.open.range, 0), | ||
| close_span: SpanStorage96::new(span.close.range, 1), | ||
| }])), | ||
| span_parts: Box::new([ | ||
| CompressedSpanPart::from_span(&span.open), | ||
| CompressedSpanPart::from_span(&span.close), | ||
| ]), | ||
| } | ||
| TopSubtreeBuilder::new(crate::Delimiter { | ||
| kind: DelimiterKind::Invisible, | ||
| open: span.open, | ||
| close: span.close, | ||
| }) | ||
| .build() |
Member
Author
There was a problem hiding this comment.
Notable change, given that the eq impl of TopSubtree relies on the backing span store, we should make sure that building an empty tree results in the same object no matter what constructor is being used, thus this change
3c4ad7e to
794c4c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All of these were AI generated and then hand-picked/cleaned up by me